<?phpdefined('LMO') or die('Can\'t access !');class LSocket {	private static $instance;	private function __constructor(){}		public static function checkSocket($ip, $port = 80, $timeout = 10, $result = false, $token = null)	{		if(!function_exists('fsockopen')) {			exit('fsockopen doesn\'t support !');		}				$rs = false;				if (empty($ip)) {			return false;		}				try {			$fp = @fsockopen($ip, $port, $errno, $errstr, $timeout);			if(!$fp) {				$rs = false;			} else {				if($result == true && !empty($token)) {					$out = "GET / HTTP/1.1\r\n";					$out .= "Host: $ip\r\n";					$out .= "Connection: Close\r\n\r\n";					@fwrite($fp, $out);										$data = null;					while (!feof($fp)) {						$data .= @fgets($fp, 128);					}										if(strrpos($data, $token) === false) {						$rs = false;					} else {						$rs = true;					}				} else {					$rs = true;				}				@fclose($fp);			}		} catch(Exception $ex) {}				return $rs;	}}?>